import { getFileList, getFile } from "@/api/search";

export const downloadFile = async (args: any) => {
  console.log("args", args);

  let res: any = await getFile({
    ...args,
  });
  // console.log(row)
  let download_url = URL.createObjectURL(res);
  const url = download_url;
  const link = document.createElement("a");
  link.href = url;
  link.download = args?.fileName || new Date();
  document.body.appendChild(link);
  link.click();
  document.body.removeChild(link);
};
